/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package pw.yitree.game;

/**
 *
 * @author Administrator
 */
public enum FiveElement {
    金("金"),
    木("木"),
    水("水"),
    火("火"),
    土("土");

    private final String code;

    FiveElement(String code) {
        this.code = code;
    }

    public static FiveElement fromCode(String code) {
        switch (code) {
            case "金":
                return 金;
            case "木":
                return 木;
            case "水":
                return 水;
            case "火":
                return 火;
            case "土":
                return 土;

        }
        return 金;
    }

    public String getCode() {
        return code;
    }
}
